//
//  NSDictionary+MC_SafeValue.h
//  RetainCount
//
//  Created by liuxiang on 2017/12/4.
//  Copyright © 2017年 liuxiang. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@interface NSDictionary (MC_SafeValue)
- (BOOL) mc_hasKey:(NSString *)key;

- (NSString*) mc_stringForKey:(id)key;

- (NSNumber*) mc_numberForKey:(id)key;

- (NSDecimalNumber *) mc_decimalNumberForKey:(id)key;

- (NSArray*) mc_arrayForKey:(id)key;

- (NSDictionary*) mc_dictionaryForKey:(id)key;

- (NSInteger) mc_integerForKey:(id)key;

- (NSUInteger) mc_unsignedIntegerForKey:(id)key;

- (BOOL) mc_boolForKey:(id)key;

- (int16_t) mc_int16ForKey:(id)key;

- (int32_t) mc_int32ForKey:(id)key;

- (int64_t) mc_int64ForKey:(id)key;

- (char) mc_charForKey:(id)key;

- (short) mc_shortForKey:(id)key;

- (float) mc_floatForKey:(id)key;

- (double) mc_doubleForKey:(id)key;

- (long long) mc_longLongForKey:(id)key;

- (unsigned long long) mc_unsignedLongLongForKey:(id)key;

- (NSDate *) mc_dateForKey:(id)key dateFormat:(NSString *)dateFormat;

//CG
- (CGFloat) mc_CGFloatForKey:(id)key;

- (CGPoint) mc_pointForKey:(id)key;

- (CGSize) mc_sizeForKey:(id)key;

- (CGRect) mc_rectForKey:(id)key;
@end

#pragma --mark NSMutableDictionary setter

@interface NSMutableDictionary(MC_SafeValue)

-  (void) mc_setObj:(id)i forKey:(NSString*)key;

-  (void) mc_setString:(NSString*)i forKey:(NSString*)key;

-  (void) mc_setBool:(BOOL)i forKey:(NSString*)key;

-  (void) mc_setInt:(int)i forKey:(NSString*)key;

-  (void) mc_setInteger:(NSInteger)i forKey:(NSString*)key;

-  (void) mc_setUnsignedInteger:(NSUInteger)i forKey:(NSString*)key;

-  (void) mc_setCGFloat:(CGFloat)f forKey:(NSString*)key;

-  (void) mc_setChar:(char)c forKey:(NSString*)key;

-  (void) mc_setFloat:(float)i forKey:(NSString*)key;

-  (void) mc_setDouble:(double)i forKey:(NSString*)key;

-  (void) mc_setLongLong:(long long)i forKey:(NSString*)key;

-  (void) mc_setPoint:(CGPoint)o forKey:(NSString*)key;

-  (void) mc_setSize:(CGSize)o forKey:(NSString*)key;

-  (void) mc_setRect:(CGRect)o forKey:(NSString*)key;
@end
